package com.one.efaimaly.order.ui.binder;

import android.support.annotation.NonNull;
import android.view.View;

import com.one.common.callback.OnBinderItemClickListener;
import com.one.common.view.multitytype.adapter.BaseItemBinder;
import com.one.common.view.multitytype.adapter.BaseViewHolderMulti;
import com.one.efaimaly.R;
import com.one.efaimaly.order.model.item.AddItem;

/**
 * creator: zhulunjun
 * time:    2018/8/10
 * describe:
 */
public class AddBtnBinder extends BaseItemBinder<AddItem> {
    private OnBinderItemClickListener<AddItem> onBinderItemClickListener;
    public AddBtnBinder(OnBinderItemClickListener<AddItem> onBinderItemClickListener) {
        super(R.layout.item_add_m);
        this.onBinderItemClickListener = onBinderItemClickListener;
    }

    @Override
    protected void bindView(@NonNull final BaseViewHolderMulti holder, @NonNull final AddItem item) {
        holder.getView(R.id.tv_btn_add).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBinderItemClickListener.onItemClick(view, holder.getLayoutPosition(), item);
            }
        });
    }
}
